import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);


export default new Router({
    routes: [
        // 主页——马娆
        {
            path: "/home",
            name: 'home',
            component: () => import('../components/marao/views/home')
        },
        // 限时秒杀——马娆
        {
            path: "/mszq",
            name: "mszq",
            component: () => import('../components/marao/views/mszq')
        },
        // 详情页——尚乐
        {
            path: "/detail1",
            name: "detail1",
            component: () => import('../components/leshang/pages1/leshang_detail')
        },
        {
            path: "/detail",
            name: "detail",
            component: () => import('../components/hx/detail/detail')
        },
        // 香水——马娆
        {
            path: "/xiang",
            name: "xiang",
            component: () => import('../components/marao/views/xiang')
        },
        // 香水——面霜——马娆
        {
            path: "/xiasss",
            name: "xiasss",
            component: () => import('../components/marao/views/mianshuang')
        },
        //腕表——尚乐
        {
            path: "/watch",
            name: "watch",
            component: () => import('../components/leshang/pages1/leshang_watch')
        },
        // 护肤——杨霏
        {
            path: "/hufu",
            name: "hufu",
            component: () => import('../components/yangfei/views/hufu')
        },
        //护肤——面霜——杨霏
        {
            path: "/mianshuang",
            name: "mianshuang",
            component: () => import('../components/yangfei/views/mianshuang')
        },
        //护肤——面霜——搜索——杨霏
        {
            path: "/search",
            name: "search",
            component: () => import('../components/yangfei/views/search')
        },
        // 分类——杨霏
        {
            path: "/classify",
            name: "classify",
            component: () => import('../components/yangfei/views/classify')
        },
        // 彩妆——何璇
        {
            path: "/caizhuang",
            name: "caizhuang",
            component: () => import('../components/hx/caizhuang/caizhuang')
        },
        // 彩妆——腮红——何璇
        {
            path: "/saihong",
            name: "saihong",
            component: () => import('../components/hx/saihong/saihong')
        },
        // 我的中免——和旋
        {
            path: "/mycom",
            name: "mycom",
            component: () => import('../components/hx/mycom/mycom')
        },
        // 我的中免——五组件——和旋
        {
            path: "/executory",
            name: "executory",
            component: () => import('../components/hx/executory/executory')
        },
        {
            path: "/executory2",
            name: "executory2",
            component: () => import('../components/hx/executory/executory2')
        }
        ,
        {
            path: "/executory3",
            name: "executory3",
            component: () => import('../components/hx/executory/executory3')
        }
        ,
        {
            path: "/executory4",
            name: "executory4",
            component: () => import('../components/hx/executory/executory4')
        }
        ,
        {
            path: "/executory5",
            name: "executory5",
            component: () => import('../components/hx/executory/executory5')
        },
        // 国潮———邓磊
        {
            path: "/Gcsspage",
            name: "Gcsspage",
            component: () => import('../components/dl/views/Gcsspage')
        },
        // 国潮轮播图商品——邓磊
        {
            path: "/Gcss",
            name: "Gcss",
            component: () => import('../components/dl/views/Gcss')
        },
        // 商品详情页
        {
            path: "/Purchase",
            name: "Purchase",
            component: () => import('../components/dl/views/Purchase')
        },
        // xinxi——何璇
        {
            path: '/xinxi',
            name: 'xinxi',
            component: () => import('../components/hx/xinxi/xinxi')
        },
        // 登录——马娆
        {
            path: '/dl',
            name: 'dl',
            component: () => import('../components/marao/views/dl')
        },
        // 注册——马娆
        {
            path: '/zc',
            name: 'zc',
            component: () => import('../components/marao/views/zc')
        },
        {
            path: '/goshopi',
            name: 'goshopi',
            component: () => import('../components/marao/views/mycar')
        },
        // 404——何璇
        {
            path: '*',
            name: 'erro404',
            component: () => import('../components/hx/erro404.vue')
        }

    ],
    mode: "history"
});

const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) {
    if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
    return originalPush.call(this, location).catch(err => err)
}